#!ipxe

# Mageia Operating System
# http://www.mageia.org/

# No way to set the network interface by MAC address, let the installer ask the question
isset ${dhcp-server} && set network dhcp || set network static,ip:${ip},netmask:${netmask},gateway:${gateway},dns:${dns}

goto ${menu} ||

:mageia
set os {{ releases.mageia.name }}
menu ${os} - ${arch}
{% for item in releases.mageia.versions %}
item {{ item.code_name }} ${space} ${os} {{ item.name }}
{% endfor %}
choose version || goto mageia_exit
goto mageia_boot

:mageia_boot
set dir ${mageia_base_dir}/distrib/${version}/x86_64 && set dir2 isolinux/x86_64 ||
iseq ${arch} i386 && set dir ${mageia_base_dir}/distrib/${version}/i586 && set dir2 isolinux/i386 ||
set automatic method:http,network:${network},server:${mageia_mirror},directory:/${dir}
imgfree
kernel ${mageia_mirror}/${dir}/${dir2}/vmlinuz automatic=${automatic} vga=788 splash=silent {{ kernel_params }}
initrd ${mageia_mirror}/${dir}/${dir2}/all.rdz
echo
echo MD5sums:
md5sum vmlinuz all.rdz
boot || goto mageia

:mageia_exit
clear menu
exit 0
